/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package client_server.mail;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import static java.lang.System.in;
import static java.lang.System.out;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Lucas Nguyen
 */
public class xacnhan {
    private String user;
    private String pass;
    Socket socket;
    BufferedReader intput;
    PrintWriter output;
    
    
    public xacnhan(String user, String pass) {
        this.user = user;
        this.pass = pass;
        //size=getSize();
    }
   
    void xacthuc (){
     try {
            socket = new Socket("nhom5.no-ip.org", 110);
            intput = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            output = new PrintWriter(socket.getOutputStream(), true);
            send("USER " + user, true);
            send("PASS " + pass, true);
            send("STAT", true);
            end("QUIT", true);
            send("QUIT", true);
            intput.close();
            output.close();
            socket.close();
     }
     catch(IOException e){}
    }

    private void send(String string, boolean b) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    private void end(String quit, boolean b) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
     public static void main(String[] args) throws Exception {
        final xacnhan pop = new xacnhan("hoangthach@nhom5.no-ip.org", "1");
     
     }
}
